
package com.android.finaltracer;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.android.finaltracer.engine.EngineService;
import com.android.finaltracer.model.FTDataProvider.RelationColumns;
import com.android.finaltracer.ui.FuncShowTabMainActivity;
import com.android.finaltracer.ui.WizardHelpActivity;
import com.android.finaltracer.util.StateSharedPreferences;

public class MainActivity extends Activity {

    /*
     * FIXME: need to store this item with persistent location.
     */

    private TextView mWellCome;
    private TextView mWellCome2;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // start service
        Intent sIntent = new Intent();
        sIntent.setClass(MainActivity.this, EngineService.class);
        startService(sIntent);

        if (StateSharedPreferences.getInstance(this).getFirstRunState()) {

            setContentView(R.layout.main);
            mWellCome = (TextView) findViewById(R.id.wellcome);
            mWellCome2 = (TextView) findViewById(R.id.wellcome2);
            mWellCome2.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Intent intent = new Intent();
                    intent.setClass(MainActivity.this, WizardHelpActivity.class);
                    startActivity(intent);
                    finish();
                }

            });

        } else {
            Intent intent = new Intent();
            intent.setClass(MainActivity.this, FuncShowTabMainActivity.class);
            startActivity(intent);
            finish();

        }
    }

    @Override
    protected void onStop() {
        super.onStop();

        finish();
    }
}
